package GUI;

import java.awt.Container;
import java.awt.GridBagConstraints;
import java.awt.GridBagLayout;
import java.awt.GridLayout;

import javax.swing.*;

public class Main {

    public static void ShowGUI(String[] args) {

        Controller c = new Controller();
        String traderID = c.getTraderID();
        JFrame mainUI = new JFrame(traderID);
        mainUI.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);

        Container pane = mainUI.getContentPane();
        pane.setLayout(new GridLayout(6, 1));

        JPanel radioButton = new buysellButton(c);
        pane.add(radioButton);

        JPanel stockID = new StockID(c);
        pane.add(stockID);

        JPanel amount = new Amount(c);
        pane.add(amount);

        JPanel price = new Price(c);
        pane.add(price);

        JPanel offerTime = new OfferTime(c);
        pane.add(offerTime);


        JPanel submitButton = new submitButton(c);
        pane.add(submitButton);

        mainUI.pack();
        //mainUI.setSize(230, 220);
        mainUI.setVisible(true);

    }

    public static void main(String[] args) {
        //register itself
        ShowGUI(args);
        return;
    }
}
